<?php

declare (strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Model;

class InformationRecruitment extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected ?string $table = 'information_recruitment';
    public function information()
    {
        return $this->belongsTo(Information::class, 'information_id');
    }
    public function city()
    {
        return $this->belongsTo(City::class, 'city_id');
    }
    public function enterprise()
    {
        return $this->belongsTo(Enterprise::class, 'enterprise_id');
    }
    public function info()
    {
        return ['name' => $this->name ?? '', 'city_id' => $this->city_id ?? '', 'city' => $this->city->name ?? '', 'pay' => $this->pay ?? '面议', 'duty' => $this->duty ?? '', 'material_benefits' => explode(',', $this->material_benefits ?? ''), 'enterprise' => $this->enterprise->name ?? ''];
    }
}